<!DOCTYPE html>
<html lang="en" manifest="/header.appcache">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="author" content="chinadangmai.com">
    <meta name="description" content="当买">
    <meta name="keywords" content="当买">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <title>当买-众筹</title>
    <script src="../../js/edition.js"></script>   
    <link rel="stylesheet" href="../../css/base.css">
    <link rel="stylesheet" href="../../css/popover.css">
    <link rel="stylesheet" href="../../css/style.css">
    <script>
       document.write("<l"+"ink rel='stylesheet' href='../../css/index.css?version="+edition+"'>")
    </script>
    <script>
        document.write("<l"+"ink rel='stylesheet' href='../../css/crowdfunding.css?version="+edition+"'>")
    </script>
    <script src="../../js/jquery.js"></script>
    <script src="../../js/template.js"></script>
    <script src="../../js/jquery.cookie.js"></script> 
    <script src="../../js/popover.js"></script>  
    <script> 
       document.write("<s"+"cript type='text/javascript' src='../../js/url.js?version="+edition+"'></scr"+"ipt>"); 
    </script>
    <script> 
       document.write("<s"+"cript type='text/javascript' src='../../js/index.js?version="+edition+"'></scr"+"ipt>"); 
    </script>
    <script> 
       document.write("<s"+"cript type='text/javascript' src='../../js/header.js?version="+edition+"'></scr"+"ipt>"); 
    </script>
    <script src="../../js/index_floor.js"></script>
    <script src="../../js/index_foot.js"></script>
    
    <script src="../../js/cookie.js"></script>  
    <script> 
       document.write("<s"+"cript type='text/javascript' src='../../js/login.js?version="+edition+"'></scr"+"ipt>"); 
    </script>   
    <script> 
        document.write("<s"+"cript type='text/javascript' src='js/crowdfunding_detail.js?version="+edition+"'></scr"+"ipt>"); 
     </script>
     <script type="text/javascript" src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js" data-appid="101353641" data-redirecturi="http://www.chinadangmai.com" charset="utf-8"></script>
     <!-- <script src="http://tjs.sjs.sinajs.cn/open/api/js/wb.js?appkey=403690515&debug=true" type="text/javascript" charset="utf-8"></script> -->
     <script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
     <script src="../../js/nav_hover.js"></script>
</head>
<body>   
    <header class="mod_head"></header>
    <script>
        $(function(){
            var src=$('.mod_logo img').attr('src')
            $('.mod_logo img').attr('src','../'+src)
        })   
    </script>
    <!-- 主体内容 start -->
    <div class="crowd_wrap" style="margin-top: 30px;">
        <div class="crowd_left">
            <div class="crowd_detail_bg">正在加载中</div>
            <div class="crowd_detail">
                <!-- 项目名称 -->
                <p class="item_name" id="itemName"></p>
                <div class="detailTitle_box">
                    <ul class="detail_tit">
                        <li class="detail_top active">项目详情</li>
                        <li class="topic_top">项目话题</li>
                    </ul>
                    <div class="bt_line"></div>
                </div>
                <!-- 项目详情 -->
                <div class="detail_wrap item_detai">
                    <video id="itemVideo" controls autoplay loop>
                        <!-- 视频播放 -->
                    </video>
                    <!-- 图文详情 -->
                </div>
                <!-- 项目话题 -->
                <div class="detail_wrap item_topic" style="display: none;">
                    <ul class="topic_list"><!-- 项目话题列表 --></ul>
                </div>
            </div>
        </div>
        <!-- 项目话题列表 -->
        <script id="topicContentTpl" type="text/html">
            {{ for( var i=0;i < topicContentList.length;i++){ }}
                <li>
                    <p class="topic_name">{{=topicContentList[i].topicContent}}</p>
                    <ul class="top_image" id="topicImage{{=topicContentList[i].topicCommentId}}">
                        <!-- 话题图片 -->
                    </ul>
                    <p class="topic_time_wrap">
                        <span class="topic_time">{{=topicContentList[i].addTime}}</span>
                        <span class="commentlist_num" data-ifag="true"  data-id="{{=topicContentList[i].topicId}}">（评论{{=topicContentList[i].commentNum}}）</span>
                    </p>
                    <div class="topic_commen">
                        <div class="topic_input">
                            <input type="text" class="topic_info">
                            <a href="javascript:;" class="topic_btn" data-id="{{=topicContentList[i].topicId}}">发布评论</a>
                        </div>
                        <ul class="topic_commentlist" id="commentList{{=topicContentList[i].topicId}}">
                        <!-- 该话题评论列表 -->   
                        </ul>
                        <ul class="topic_page" data-topicId="{{=topicContentList[i].topicId}}">
                            <!-- 话题评论分页模板 -->
                        </ul>
                    </div>
                </li>
            {{ } }}
        </script>
        <!-- 该话题评论列表 -->
        <script id="commentlistTpl" type="text/html">
            {{ for( var i=0;i < commentlist.length;i++){ }}
                <li>
                    <div class="memberAvatar"><img src="../../img/base/member_msg_pic.png" ></div>
                    <div class="comment_info">
                        <p class="comment_txt">
                            <span class="nickName">{{=commentlist[i].nickName}}：</span>
                            {{=commentlist[i].content}}
                        </p>
                        <p class="comment_time">{{=commentlist[i].addTime}}</p>
                    </div>
                </li>
            {{ } }}
        </script>
        <!-- 话题图片 -->
        <script id="topicImageTpl" type="text/html">
            {{ for( var i=0;i < topicImageList.length;i++){ }}
                <li><img src="{{=topicImageList[i].topicImage}}" /></li>
            {{ } }}
        </script>
        <!-- 话题评论分页模板 -->
        <script id="topicPageTpl" type="text/html">
            {{ for( var i=0;i<topicPageList.length; i++){ }}
                <li id="page{{=topicPageList[i].index}}">{{=topicPageList[i].index}}</li>
            {{ } }}
        </script>
        <div class="crowd_right">
            <div class="crowd_server_bg">正在加载中</div>
            <div class="crowd_server">
                <p class="item_name" id="itemNameOne"></p>
                <p class="raised_txt">已筹集</p>
                <div class="raised_price">
                     <!-- 已筹集的资金 -->
                </div>
                <p class="raised_jd">进度：0.0%</p>
                <div class="crowd_jd_box" style="margin-bottom:5px;">
                    <div class="crowd_jd_bg"></div>
                    <div class="crowd_jd"></div>
                </div>
                <p class="raise_timeRemaining">项目剩余时间：</p>
                <p class="raise_expectedAmount">目标金额：</p>
                <div class="raise_btn">
                    <a href="javascript:;" class="item_collect">收藏（0）</a>
                    <div class="share_btn">
                        <a href="javascript:;" class="item_share">分享</a>
                        <div class="bdsharebuttonbox">
                            <a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
                            <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
                            <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
                            <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
                        </div>
                    </div>
                    
                </div>
            </div>
            <!-- 该众筹项目的档位列表 -->
            <ul class="item_list"><!-- 档位列表 --></ul>
        </div>
        <!-- 档位列表 -->
        <script id="itemListTpl" type="text/html">
            {{ for( var i=0;i < itemList.length;i++){ }}
                <li>
                    <div class="item_list_top" data-unit-price="{{=itemList[i].unitPrice}}">
                        <span class="item_price">￥{{=itemList[i].unitPrice}}</span>
                        <span class="item_support">{{=itemList[i].purchaseQuantityNow}}支持者</span>
                    </div>
                    <p class="item_name" data-gear-name="{{=itemList[i].gearsName}}">{{=itemList[i].gearsName}}</p>
                    <p class="item_info item_freight" data-freight="{{=itemList[i].itemFreight}}">配送费用：￥{{=itemList[i].itemFreight}}</p>
                    <p class="item_info return_time">发货时间：众筹完成后<span>{{=itemList[i].returnTime}}天</span>内发货</p>
                    <p class="item_info item_storage" data-surplus="{{=itemList[i].surplus}}"><span>总{{=itemList[i].itemStorage}}份</span><span class="surplus" data-surplus="{{=itemList[i].surplus}}">剩{{=itemList[i].surplus}}份</span></p>
                    <div class="item_btm">
                        <div class="item_num" data-a="{{=itemList[i].num}}">
                            <span class="num_minus">-</span>
                            <input type="text" class="goods_num" name="num" value="1">
                            <span class="num_add">+</span>
                            <input type="hidden" value="{{=itemList[i].num}}" name="limit_shopping">
                            <input type="hidden" class="surplus" value="{{=itemList[i].surplus}}" name="surplus">
                        </div>
                        <span class="limit_num">{{=itemList[i].purchaseRestriction}}</span>
                        <a href="javascript:;" class="support_btn" data-item-id="{{=itemList[i].itemId}}" data-item-image="{{=itemList[i].itemImage}}">立即支持</a>
                    </div>
                </li>
            {{ } }}
        </script>
    </div>
    <!-- 主体内容 end -->
    <!-- 网站底部 start -->
    <footer class="mod_foot"></footer>
    <!-- 网站底部 end -->
    <!-- 登录弹窗 -->
    <div class="popover_m" style="display:none"></div>
    <div class="site_bg" style="display:none">
        <span class="gb_01" style="display:block;width:18px;height:18px;background:url(../images/base/icon_06.png) 0 0 no-repeat;float:right;margin:40px 30px 0 0;cursor: pointer; position: absolute; z-index: 1;right: 30px"></span>
        <form class="register_tab">
            <div class="login_bg" style="width:100%; border:0;">
                <input type="hidden" name="" value="" class="qc_token">
                <p class="login_title" style="width:100%; height:89px; line-height:89px; color:#fff; font-weight:600">用户登录</p>
                <ul style="margin-top:20px;">
                    <li>
                        <em>账<i style="width: 24px; display: inline-block;"></i>号</em>
                        <input type="text" name="phone" id="phone" placeholder="请输入手机号">
                        <div class="error">请输入正确的用户名</div>
                    </li>
                    <li>
                        <em>密<i style="width: 24px; display: inline-block;"></i>码</em>
                        <input type="password" name="password" maxlength="18" id="password" placeholder="请输入密码">
                        <div class="error">请输入正确的密码</div>
                    </li>
                </ul>
                <div class="select">
                    <p class="fl_l">
                    还没账号？<a href="../login/register.html">前往注册>></a>
                    </p>
                    <a href="../login/retrieve_password.html" class="fl_r">忘记密码?</a>
                </div>              
                <div class="login_sub"><input type="submit" value="登录" id="login_sub"></div>
                <div class="s_login">
                    <dl>
                        <dd data-type="1"  style="width:50%"><span id="qqLoginBtn"></span><a href=""><img src="../../img/login/qq.png" alt="" srcset=""></a></dd>      
                        <dd style="width:50%" class="wx_login" data-type="3"><a><img src="../../img/login/wx.png" alt="" srcset=""></a></dd>
                        <!-- // popo_lo+='<dd data-type="2">'
                        // popo_lo+='<div id="wb_connect_btn">'
                        // popo_lo+='<wb:login-button onlogin="login" onlogout="logout"></wb:login-button>'
                        // popo_lo+='</div>'
                        // popo_lo+='<a><img src="../images/login/wb.png" alt="" srcset=""></a>'
                        // popo_lo+='</dd>' -->
                    </dl>
                </div>          
            </div>
        </form>
    </div>
    <div class="login_container_bg"></div>
    <div id="login_container">
</div>
<!-- 图片弹窗 start -->
<div class="pic_pop_bg"></div>
<div class="pic_img"><img src="" /></div>
<!-- 图片弹窗 end -->
<script>
    $(function(){
        $('.pic_pop_bg').click(function(){
            $('.pic_pop_bg').css('display','none');
            $('.pic_img').css('display','none');
        });
        $('.pic_img').click(function(){
            $('.pic_pop_bg').css('display','none');
            $('.pic_img').css('display','none');
        });
    })
</script>
</body>
</html>
<script>
    $(function(){
        if($.cookie('user')!=''&&$.cookie('user')!=null){
            // 是否登录
            strs=$.cookie('user').split(",")
            var token=''
            for(var i in strs){
                token=strs[6]
            } 
        }else{
            var QC_openId=''
            var QC_Token=''
            var data_type=''
            $('#qqLoginBtn').click(function(){
                data_type=$(this).parents('dd').attr('data-type')
            })
            $(function(e){
                // qq登录
                //调用QC.Login方法，指定btnId参数将按钮绑定在容器节点中
                QC.Login({
                    // btnId：插入按钮的节点id，必选
                    btnId:"qqLoginBtn",    
                });
                //get_user_info是API参数//指定接口访问成功的接收函数，s为成功返回Response对象
                QC.api("get_user_info", {}).success(function (s){           
                    //成功回调，通过s.data获取OpenAPI的返回数据           
                    nick = s.data.nickname; //获得昵称           
                    headurl = s.data.figureurl_qq_1; 
                    //获得头像              
                    if (QC.Login.check()){
                        //判断是否登录               
                        QC.Login.getMe(function(openId, accessToken){ 
                            //这里可以得到openId和accessToken            
                            QC_openId=openId   
                            QC_Token=accessToken 
                            $('.qc_token').val(QC_Token) 
                            // $.cookie('QC_Token','QC_Token',{path:'/'})
                        });           
                    }    
                }).error(function(f){           
                    //失败回调           
                    alert("获取用户信息失败！");       
                }).complete(function(c){
                    //完成请求回调    
                    setTimeout(function(){
                        var token=$('.qc_token').val()
                        $.ajax({
                            url:new_url+'shop/oauth/oauthLogin',
                            type:'post',
                            data:{oauthType:'2',accessToken:token},
                            dataType:'json',
                            success:function(e){
                                if(e.code=='2007'){
                                    var this_u=window.location.href
                                    $.cookie('this_u',this_u,{path:'/'})
                                    tc(e.message)
                                    setTimeout(function(){
                                        window.location.href='/login/binding.html?oauthId='+e.data.oauthId+'&'+'1'
                                    },300) 
                                    QC.Login.signOut()
                                }  
                                if(e.code=='0'){
                                    tc(e.message)
                                    var mycars = new Array()
                                    mycars[0] = e.data.name
                                    mycars[1] = e.data.nickName
                                    mycars[2] = e.data.phone
                                    mycars[3] = e.data.avatar
                                    mycars[4] = e.data.truename
                                    mycars[5] = e.data.memberId
                                    mycars[6] = e.data.token
                                    mycars[7] = 
                                    $.cookie('user',mycars,{path:'/'});
                                    var url=window.location.href
                                    var size=url.split('=')[1]
                                    // console.log(size)
                                    // var u=url.split('m/')[1]
                                    // console.log(u)
                                    // console.log(size)
                                    // if(size==='1'){
                                    //     setTimeout(function(){
                                    //         window.location.href='/index.html'  
                                    //         return false;   
                                    //     },1100)   
                                    // }
                                    // if(size==='2'){
                                    //     setTimeout(function(){
                                    //         window.history.go(-1) 
                                    //         return false;
                                    //             // window.location.href=url+'/index.html'
                                    //     },1100)
                                    // }
                                    // if(size===undefined){
                                    //     setTimeout(function(){
                                    //         window.location.href='/index.html'   
                                    //         return false;  
                                    //     },1100) 
                                    // }
                                    // if(size!='1'&&size!='2'&&size!=undefined){
                                    setTimeout(function(){
                                            window.location.reload()
                                            $.cookie('this_u','',{path:'/'})
                                            return false;  
                                    },1100)
                                    // } 
                                    QC.Login.signOut()
                                }
                            }
                        })
                        return false
                    },300) 
                });
            })
            // 微信登陆
            $('.wx_login').click(function(){
                var this_u=window.location.href
                $.cookie('this_u',this_u,{path:'/'})
                // var url='https://open.weixin.qq.com/connect/qrconnect?appid=wx39e3c56e1f6d718e&redirect_uri=http%3a%2f%2fdm.bgemall.com&response_type=code&scope=snsapi_login&state=1#wechat_redirect'
                // window.location.href=url
                // $('.login_container_bg, #login_container').show()
                // $('.login_container_bg').click(function(){
                //     $('.login_container_bg, #login_container').hide()
                // })   
                window.location.href='../login/login.html?type=3'
            })
    
            // WB2.anyWhere(function (W) {
            //     W.widget.connectButton({
            //         id: "wb_connect_btn",
            //         type: '3,3',
            //         callback: {
            //             login: function (o){ 
            //                 //登录后的回调函数
            //                 //微博名称
            //                 alert(o.screen_name);
            //                 console.log(o)
            //                     // 验证是否登入成功
            //     if(WB2.checkLogin()){
            //         // api 入口
            //             // 调用 account/get_uid 接口，获取用户信息
            //             W.parseCMD('/account/get_uid.json', function(oResult, bStatus){
            //                 if(bStatus){
            //                     setTimeout(function(){
            //                     console.log($('.qc_token').val()+'.............')
            //                     var token=$('.qc_token').val()
            //                     $.ajax({
            //                         url:new_url+'shop/oauth/oauthLogin',
            //                         type:'post',
            //                         data:{oauthType:'2',accessToken:token},
            //                         dataType:'json',
            //                         success:function(e){
            //                             console.log(e)  
            //                             if(e.code=='2007'){
            //                                 tc(e.message)
            //                                 setTimeout(function(){
            //                                     window.location.href='/login/binding.html?oauthId='+e.data.oauthId
            //                                 },300) 
            //                             }  
            //                             if(e.code=='0'){
            //                                 tc(e.message)
            //                                 var mycars = new Array()
            //                                 mycars[0] = e.data.name
            //                                 mycars[1] = e.data.nickName
            //                                 mycars[2] = e.data.phone
            //                                 mycars[3] = e.data.avatar
            //                                 mycars[4] = e.data.truename
            //                                 mycars[5] = e.data.memberId
            //                                 mycars[6] = e.data.token
            //                                 mycars[7] = 
            //                                 $.cookie('user',mycars,{path:'/'});
            //                                 setTimeout(function(){
            //                                     window.location.href='/index.html'
            //                                 },300) 
            //                             }
            //                         }
            //                     })
            //                 },300)  
            //                 }
            //             }, {}, {
            //                 method : 'get',
            //                 cache_time : 30
            //             });
            //     }
            //     }
            //     }
            //     });
            // });
            // //微博退出：
            // WB2.logout(function() {
            //         window.location.href='/';//跳转或干你想干的事情
            // });
            // $('.buy_now_btn').attr('href','/cart/pay_commit.html?goodsid='+id);
        }
    });
</script>
<!-- 分享 -->
<script>
    $(function(){
        // 分享按钮显示
        $('.share_btn').mouseover(function(){
            $('.bdsharebuttonbox').css('display','block');
            var itemName=$('.itemName').val();
            var itemSummary=$('.itemSummary').val();
            var itemImage=$('.itemImage').val();
            // 分享配置
            window._bd_share_config={
                "common":{
                    "bdSnsKey":{},
                    "bdMini":"1",
                    "bdMiniList":["qzone","tsina","weixin","sqq"],
                    "bdSize":"24",
                    "bdStyle":"0",
                    "bdText":itemName,    //自定义分享内容
                    "bdPic":itemImage,     // 自定义分享图片
                    "bdDesc":itemSummary,      // 自定义分享摘要
                    'bdComment':'您的自定义分享评论',    // 自定义分享评论
                },
                "share":{}
            };
            with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];

        });
        // 分享按钮隐藏
        $('.share_btn').mouseout(function(){
            $('.bdsharebuttonbox').css('display','none');
        });
    });
</script>
<script>
	$(function(){
		// 底部小图标路径修改
		$('.foot_list>img').each(function(){
			var src = $(this).attr('src');
			$(this).attr('src','../../'+src);
		});
		// 底部链接修改
		$('.footer_ul a').each(function(){
			var newHref = $(this).attr('href');
			if(newHref!='javascript:;'){
				$(this).attr('href','..'+newHref);
			}
		});
	});
</script> 